package com.yun.algorithmproblem.leetcode;

public class Leetcode1780 {

    public static void main(String[] args) {
        Leetcode1780 leetcode1780 = new Leetcode1780();
        int n = 12;
        System.out.println(leetcode1780.checkPowersOfThree(n));
    }

    public boolean checkPowersOfThree(int n) {
        while (n > 0) {
            if (n % 3 == 2) {
                return false;
            }
            n /= 3;
        }
        return true;
    }
}
